package com.letoken.platform.repo.mall.dao;

import com.letoken.platform.repo.dao.SpiceBaseMapper;
import com.letoken.platform.repo.mall.po.AppMallPromotion;
import com.letoken.platform.repo.mall.po.AppMallPromotionIds;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 星推官下级商家增加记录 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2023-06-14
 */
public interface AppMallPromotionIdsMapper extends SpiceBaseMapper<AppMallPromotionIds> {

    @Select("select 1 from app_mall_promotion_ids where user_id = #{userId} and below_mall_user_id = #{belowMallUserId} limit 1")
    Integer idIsExists(@Param("userId") Integer userId,@Param("belowMallUserId") Integer belowMallUserId);

    @Select("select 1 from app_mall_promotion_ids where  below_mall_user_id = #{belowMallUserId} limit 1")
    Integer idExistsSub(@Param("belowMallUserId") Integer belowMallUserId);


}
